'''
Function:
    定义地图
author:
    walker
time:
    2020/5/14
'''

class Grid():
    def __init__(self):
        self.info = '根据grid（也就是橡子）的位置更改地图'

    def grid_to_string(self,grid,player):
        if grid[player.row][player.col] == 'W':
            player.num_water_buckets += 1
        if grid[player.row][player.col] == 'F':
            player.num_water_buckets -= 1
        grid[player.row_pre][player.col_pre] = ' '
        grid_list_str = ''
        grid[player.row][player.col] = player.display
        for grid_item in grid:
            grid_list_str += ''.join(grid_item)
            grid_list_str += '\n'

        return grid_list_str,player.num_water_buckets
